<!--
*Author：富行天下团队

 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/product/Mall_procure_product.js此处编写
 -->
<template>
	<div>
		<view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields" :editFormFileds="editFormFields" :editFormOptions="editFormOptions"
			:searchFormFields="searchFormFields" :searchFormFileds="searchFormFields" :searchFormOptions="searchFormOptions" :table="table" :extend="extend"></view-grid>
	</div>
</template>

<script>
	import extend from "@/extension/Product/Mall_procure_product.js";
	import ViewGrid from "@/components/basic/ViewGrid.vue";
	var vueParam = {
		components: {	ViewGrid },
		data() {
			return {
				table: {
					key: 'id',
					footer: "Foots",
					cnName: '采购产品',
					name: 'Mall_procure_product',
					url: "/Mall_procure_product/",
					sortName: "createDate"
				},
				extend: extend,
				editFormFields: {
					name:'',
					name2:'',
					pics:[],
					onlinestatus:null,
					unit:'',
					bookType:null,
					description:'',
					merchantCode: '',
        	merchantName: '',
					orderLimitMax:null,
					orderLimitMin:null,
					bookingNoticeName:'',
					costprice:'',
					type:[],
					code:'',
					rulesOfUse:'',
					txtidname:'',
					stockTotal:'',
					stairsRefund:'',
					partlyRefund:'',
					refundType:'',
					timeContainer:'',
					agreementid:'',
					supplierCode:'',
					scenic_poiId:'',
				},
				editFormOptions: [
					[ 
						{ title:"采购供应商",field:"supplierCode",type:"select",dataKey: 'procurementsupplier',data: [],required: true},
						{ title:"景区编号",field:"scenic_poiId",type:"select",data: [],required: true}
					],
					[
						{ title: '采购产品名称', required: true, field: 'name', type: 'text'},
						{ field: 'type', title: '产品类型', type: 'cascader', dataKey: 'tree_protype', data: [],required: true,hidden:true },
						{ field: 'typename', title: '产品类型名称',disabled: true,hidden:true},
						{ title: '编码', field: 'code', type: 'text'},
					],
					[ 
					{ field: 'stockTotal', title: '总库存', type: 'decimal',align: 'left',min: 0, required: true,},
						{ field: 'timeContainer', title: '有效时间', type: 'datetime', required: true,range: true, },
						{ data: [{value:'在线',key:1}, {value:'下线',key:2}], title: '产品在线状态', required: true, field: 'onlinestatus', type: 'select'},
					],
					[
						{ dataKey: 'unit',data: [],title: '单位',required: true,	field: 'unit',type: 'select'},
						{ title: '单位名称',field: 'unit',type: 'text',hidden:true},
						{ dataKey: 'mall_test', data: [], title: '免责声明', field: 'agreementid', type: 'select',},
						{ data: [{value:'有效期',key:0}, {value:'预约模式',key:1}], title: '预订模式', required: true, field: 'bookType', type: 'select'},
					],
					// [
					// 	{ title: '使用规则名称', field: 'bookingNoticeName', required: true, type: 'text'},
					// 	{ field: 'orderLimitMax',title: '订单限制最大购买数量',type: 'decimal',align: 'left',min: 0,},
					// 	{ field: 'orderLimitMin',title: '订单限制最小购买数量',type: 'decimal',align: 'left',min: 0,},
					// ],
					
					// [
					// 	{ data: [{value:'不支持',key:0}, {value:'支持',key:1}], title: '阶梯退', required: true, field: 'stairsRefund', type: 'select'},
					// 	{ data: [{value:'不支持',key:0}, {value:'支持',key:1}], title: '部分退', required: true, field: 'partlyRefund', type: 'select'},
					// 	{ data: [{value:'只随时退',key:1}, {value:'随时急速退',key:2}, {value:'不可退',key:3}, {value:'有条件退(时间节点限制、手续费限制、只能整单退等)。',key:4}], title: '退款类型', required: true, field: 'refundType', type: 'select'},
					// ],
					[
						{ title: '成本价',required: true,field: 'costprice', type: 'decimal',colSize: 3,},
						{ title: '轮播图', maxSize: 1, field: 'pics', colSize: 9, type: 'imgupgrade',maxFile: 5, multiple: true},
					],
					[
						{ title: '使用规则',field: 'rulesOfUse',colSize: 12,type: 'textarea'},
					],
					[
						{ title: '描述',field: 'description',colSize: 12,type: 'textarea'},
					],
				],
				searchFormFields: { name:'',scenic_supplierid:'',timeContainer:''},
				searchFormOptions: [
					[
						{ title: '采购产品名称', field: 'name', type: 'text' },
						{ dataKey: 'procurementsupplier', data: [],title: '采购供应商',field: 'scenic_supplierid',type: 'select' },
						{ field: 'type', title: '产品类型',  type: 'cascader', dataKey: 'tree_protype', data: [], },
					],
					[
						{ field: 'createDate', title: '创建时间', type: 'date' },
						{ field: 'timeContainer', title: '有效时间', type: 'datetime' },
					]
				],
				columns: [
					{field:'id',title:'主键',type:'string',width:90,hidden:true,readonly:true,require:true},
					{field:'scenic_poiId',title:'景区编号',type:'string',width:120,sortable:true,hidden:true,},
					{field:'name',title:'名称',type:'string',width:180},
					{field:'code',title:'编码',type:'string',hidden:true,readonly:true,require:true},
					{field:'name2',title:'简称',type:'string',hidden:true},
					{field:'type',title:'产品类型',type:'string',hidden:true},
					{field:'typename',title:'产品类型名称',type:'string'},
					{field:'onlinestatus',title:'产品在线状态',type:'select', bind: { key: '', data: [{value:'在线',key:1}, {value:'下线',key:2}]}},
					{field:'pics',title:'轮播图',type:'imgupgrade'},
					{field:'unit',title:'单位',type:'int',hidden:true,},
					{field:'unitname',title:'单位名称',type:'string'},
					{field:'costprice',title:'成本价',type:'decimal'},
					{field:'stockTotal',title:'总库存',type:'int'},
					{field:'saleStock',title:'剩余库存数',type:'int'},
					{field:'txtid',title:'富文本id',type:'string',hidden:true,readonly:true},
					{field:'txtidname',title:'富文本名称',type:'string',hidden:true,},
					{field:'bookType',title:'预订模式',type:'select',bind: {data: [{value:'有效期',key:0}, {value:'预约模式',key:1}]}},
					{field:'agreementname',title:'免责协议文本',type:'string',hidden:true,},
					{field:'agreementid',title:'免责协议code',type:'string',hidden:true,},
					{field:'effectiveStartDate',title:'有效开始时间',type:'datetime',sortable:true},
					{field:'effectiveEndDate',title:'有效结束时间',type:'datetime',sortable:true},
					{field:'description',title:'描述',type:'string'},
					{field:'rulesOfUse',title:'使用规则',type:'string'},
					{field:'bookingNoticeName',title:'使用规则名称',type:'string',hidden:true,},
					{field:'bookingNotice',title:'预订须知',type:'string',hidden:true},
					{field:'supplierCode',title:'采购供应商',type:'string',bind: { key: 'procurementsupplier', data: []}},
					// { field: 'isAvailable',title: '是否可用', type: 'sbyte'},
        	// { field: 'isDelete',title: '是否删除',type: 'int',require: true},
					// {field:'orderLimitMax',title:'订单限制最大购买数量',type:'int'},
					// {field:'orderLimitMin',title:'订单限制最小购买数量',type:'int'},
					// {field:'stairsRefund',title:'阶梯退：0 不支持1 支持',type:'int'},
					// {field:'partlyRefund',title:'部分退：0 不支持1 支持当partlyRefund=0时refundType=4。',type:'int'},
					// {field:'refundType',title:'退款类型：1 只随时退2 随时急速退3 不可退4 有条件退(时间节点限制、手续费限制、只能整单退等)。',type:'int'},
					{field:'modifier',title:'修改人',type:'string'},
					{field:'modifyDate',title:'修改时间',type:'datetime',sortable:true},
					{field:'modifyID',title:'修改人ID',type:'int',hidden:true},
					{field:'createDate',title:'创建时间',type:'datetime',sortable:true},
					{field:'createID',title:'创建人ID',type:'int',hidden:true},
					{field:'creator',title:'创建人',type:'string'},
					{field:'merchantCode',title:'商户编码',type:'string',hidden:true},
					{field:'merchantName',title:'商户名称',type:'string',hidden:true},
					{field:'hotel_ID',title:'酒店ID',type:'string',hidden:true,readonly:true},
					{field:'hotelName',title:'酒店名称',type:'string',hidden:true,},
					{field:'pmsRoomCode',title:'房价码',type:'string',hidden:true,},
					{field:'typeParentID',title:'类型父级编码',type:'string',hidden:true,},
					{field:'spare12',title:'扩展字段1',type:'string',hidden:true,},
					{field:'spare13',title:'扩展字段1',type:'string',hidden:true,},
					{field:'spare14',title:'扩展字段1',type:'string',hidden:true,},
					{field:'spare15',title:'扩展字段1',type:'string',hidden:true,},
				],
				detail: {
					cnName:"采购商品",
					columns: [
						{field:'goodId',title:'主键',type:'string',width:90,hidden:true},
						{field:'name',title:'商品名称',type:'string',  edit: { type: 'text', required: true },},
						{field:'name2',title:'简称',type:'string', edit: { type: 'text', required: true }},
						{field:'preferentialPrice',title:'优惠价',type:'string', edit: { type: 'text', required: true }},
						{field:'settlementPrice',title:'结算价',type:'string', edit: { type: 'text', required: true }},
						{field:'attributes',title:'属性',type:'string',},
						{field:'originalPrice',title:'原价',type:'decimal',edit: { type: 'text', required: true }},
						{field:'spare13',title:'房型编码',type:'string',hidden:true},
						{field:'num',title:'数量',type:'int',width:90,edit: { type: 'text', required: true }},
						{field:'stockTotal',title:'总库存',type:'int',width:90, edit: { type: 'text', required: true }},
						{field:'saleStock',title:'剩余库存数量',type:'int',width:90},
						{field:'attributesName',title:'属性',type:'string',hidden:true,},
						{field:'uiType',title:'ui类型',type:'string',hidden:true,},
						{field:'id',title:'产品ID',type:'string',width:90,hidden:true},
						{field:'spare7',title:'冬夏令营限制人数',type:'string',hidden:true,},
						{field:'spare8',title:'营位时间是否跨天',type:'string',hidden:true,},
						{field:'spare9',title:'营位房型',type:'string',hidden:true,},
						{field:'spare10',title:'营地批次开始时间',type:'string',hidden:true,},
						{field:'spare11',title:'营地批次结束时间',type:'string',hidden:true,},
						{field:'spare12',title:'套票商品子项数组json',type:'string',width:90,hidden:true,},
						{field:'spare14',title:'pms房价码',type:'string',hidden:true,edit: { type: 'text' },},
						{field:'spare15',title:'房型',type:'string',hidden:true,},
						{field:'code',title:'商品编码',type:'string',hidden:true},
						{field:'isDelete',title:'是否删除',type:'int',width:90,hidden:true},
						{field:'offlineCode',title:'线下编码',type:'string',hidden:true},
						{field:'campsitePhaseId',title:'营地批次ID',type:'int',width:90,hidden:true,},
						{field:'regular_bus_detail',title:'班车路线时间表ID',type:'string',hidden:true,},
						{field: 'breakfast_count',title: '含早餐', type: 'integer',identifying: true, width: 80, hidden: true,align: 'left', edit: { type: 'integer', keep: true },},
						{field:'cinemaseatid',title:'座位类型id',type:'string',hidden:true,},
						{field:'cinemaareaid',title:'区域id',type:'string',hidden:true,},
						{field:'cinemavenid',title:'场次id',type:'string',hidden:true,},
						{field:'site_code',title:'场馆场次code',type:'string',width:120,hidden:true,},
						{field:'siteattr',title:'影院属性',type:'string',hidden:true,},
						{field:'modifier',title:'修改人',type:'string',width:180,hidden:true,},
						{field:'modifyDate',title:'修改时间',type:'datetime',width:90,hidden:true,sortable:true},
						{field:'modifyID',title:'修改人ID',type:'int',width:90,hidden:true},
						{field:'createDate',title:'创建时间',type:'datetime',width:90,hidden:true,sortable:true},
						{field:'createID',title:'创建人ID',type:'int',width:90,hidden:true},
						{field:'spare1',title:'扩展字段1',type:'string',hidden:true,},
						{field:'spare2',title:'扩展字段2',type:'string',hidden:true,},
						{field:'creator',title:'创建人',type:'string',width:180,hidden:true,},
						{field:'spare3',title:'扩展字段1',type:'string',hidden:true,},
						{field:'spare4',title:'扩展字段1',type:'string',hidden:true,},
						{field:'spare5',title:'扩展字段1',type:'string',hidden:true,},
						{field:'spare6',title:'扩展字段1',type:'string',hidden:true,},
					],
					sortName: "goodId",
					key:"goodId"
				}
			};
		}
	};
	export default vueParam;
</script>
